package com.thread.thread.java8;

public class Test {

	public static void main(String args[]) {

		//Lambda 表达式使用外部局部变量时默认为final,所以不能修改
		final int num = 1;
		Converter<Integer, String> s = (param) -> System.out.println(String.valueOf(param + num));
		s.convert(2);  // 输出结果为 3

	}

	public interface Converter<T1, T2> {
		void convert(int i);
	}

}
